package com.itheima.reggie.common;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageInfo;

/**
 * @author ljj
 * @create 2022-11-17-12:00
 */
public class PageInfoToPageUtils {
    public static  <T> Page<T> tranto(PageInfo<T> pageInfo){
        Page<T> objectPage = new Page<>(pageInfo.getPageNum(), pageInfo.getPageSize());
        objectPage.setRecords(pageInfo.getList());
        objectPage.setTotal(pageInfo.getTotal());
        objectPage.setPages(pageInfo.getPages());
        return objectPage;
    }
}
